#pragma

#include <SockOpt.h>
#include <string>

class Socket
{
public:
    Socket();

    Socket(socket_t sockfd);

    bool getLocalSockName(std::string& ip,uint16_t& port);

    bool getPeerSockName(std::string& ip, uint16_t& port);

    bool shutdown();

    bool close();

    socket_t fd() { return sockfd_; }

    ~Socket();

private:
    int sockfd_;
};